﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace clock.time
{
    public class FileStreamReader
    {
        //拼接文件路径
        public string SplicePath(string FolderName)
        {
            string SysPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            int index = SysPath.LastIndexOf("\\", (SysPath.LastIndexOf("\\", SysPath.LastIndexOf("\\") - 1) - 1));
            string srcPath = SysPath.Substring(0, index + 1);
            return srcPath + FolderName;
        }
       

       
        // 根据路径获取文件名
        
        public string GetFileName(string Path)
        {
            return Path.Substring(Path.LastIndexOf("\\") + 1);
        }
        


        // 移动文件方法
   
        public bool CopyFile(string Path, string FilePath)
        {
            try
            {
                File.Copy(Path, FilePath);
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
   
    }
}
